<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" ng-click="cancel()">&times;</button>
    <p class="modal-title panel-title-size">添加主机</p>
</div>
<div class="modal-body panel-body">
    <form class="form-horizontal form-validation" name="addHostForm">
        <div class="form-group">
            <div class="col-lg-12">
                <label class="col-lg-2 control-label">主机名称：</label>
                <div class="col-lg-10 control-input">
                    <input type="text" name="hostName" class="form-control" ng-model="addData.hostName" validator="required" maxlength="64" maxlength-error-message="最多输入64个字符">
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-12">
                <label class="col-lg-2 control-label">IP地址：</label>
                <div class="col-lg-10 control-input">
                    <input type="text" name="hostIp" class="form-control" ng-model="addData.hostIp" validator="required" maxlength="64" maxlength-error-message="最多输入64个字符">
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-12">
                <label class="col-lg-2 control-label">类型：</label>
                <div class="col-lg-10 control-input">
                    <select class="form-control" ng-model="addData.hostType" ng-init="addData.hostType='1'" ng-change="changeType(addData.hostType)">
                        <option ng-repeat="x in sites" value="{{x.val}}">{{x.site}}</option>
                    </select>
                </div>
            </div>
        </div>
        <div ng-if="isLoad">
        <div class="form-group">
            <div class="col-lg-12">
                <label class="col-lg-2 control-label">用户名：</label>
                <div class="col-lg-10 control-input">
                    <input type="text" name="hostUser" class="form-control" ng-model="addData.hostUser" maxlength="64" maxlength-error-message="最多输入64个字符">
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-lg-12">
                <label class="col-lg-2 control-label">密码：</label>
                <div class="col-lg-10 control-input">
                    <input type="password" name="hostPwd" class="form-control" ng-model="addData.hostPwd" maxlength="64" maxlength-error-message="最多输入64个字符">
                </div>
            </div>
        </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button type="submit" class="btn btn-primary" validation-submit="addHostForm" ng-disabled="addHostForm.$invalid" ng-click="ok()">确认</button>
    <button class="btn btn-default" ng-click="cancel()">取消</button>
</div>